package google.sites.view.dialogs;

import com.google.gdata.data.sites.WebPageEntry;
import dev.tools.view.dialogs.FormDialog;
import google.sites.model.commands.webpage.RenameWebPage;
import google.sites.view.View;

import javax.swing.*;

/**
 * Created with IntelliJ IDEA.
 * User: Nuno
 * Date: 05-10-2013
 * Time: 14:52
 */
public class RenameWebPageDialog extends FormDialog<RenameWebPage>{
    private final JTextField titleField;

    public RenameWebPageDialog(WebPageEntry entry) {
        super(View.INSTANCE, new RenameWebPage(entry));
        titleField = addField("New title", new JTextField(20));
    }

    @Override
    protected void onExecuting() {
        command.setNewTitle(titleField.getText());
    }
}
